perf: Use bulk-NULL builder in replace#21849
Open
neilconway wants to merge 1 commit intoapache:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
replaceto use bulk-NULL string builder #21848.Rationale for this change
We can use the new bulk-NULL string builder APIs to reduce NULL handling overhead in
replace. There is a further opportunity for optimization once arrow/arrow-rs#9692 lands.Benchmarks:
replace size=1024/replace_string_ascii_single [str_len=32]: 17.42 µs → 14.35 µs, −17.71%replace size=1024/replace_string_view [str_len=32]: 21.23 µs → 18.89 µs, −11.05%replace size=1024/replace_string [str_len=32]: 20.42 µs → 18.51 µs, −9.36%replace size=1024/replace_large_string [str_len=32]: 20.83 µs → 18.42 µs, −11.60%replace size=1024/replace_string_ascii_single [str_len=128]: 10.61 µs → 10.37 µs, −2.22%replace size=1024/replace_string_view [str_len=128]: 28.37 µs → 28.03 µs, −1.21%replace size=1024/replace_string [str_len=128]: 27.96 µs → 28.03 µs, +0.25% (noise)replace size=1024/replace_large_string [str_len=128]: 28.15 µs → 27.95 µs, −0.70% (noise)replace size=4096/replace_string_ascii_single [str_len=32]: 68.40 µs → 56.15 µs, −17.94%replace size=4096/replace_string_view [str_len=32]: 85.95 µs → 76.84 µs, −10.61%replace size=4096/replace_string [str_len=32]: 82.79 µs → 74.71 µs, −9.76%replace size=4096/replace_large_string [str_len=32]: 85.32 µs → 75.14 µs, −11.94%replace size=4096/replace_string_ascii_single [str_len=128]: 38.35 µs → 39.10 µs, +1.96% (small regression)replace size=4096/replace_string_view [str_len=128]: 132.77 µs → 128.08 µs, −3.53%replace size=4096/replace_string [str_len=128]: 127.71 µs → 128.29 µs, +0.46% (noise)replace size=4096/replace_large_string [str_len=128]: 131.97 µs → 128.68 µs, −2.49%What changes are included in this PR?
replaceAre these changes tested?
Yes, covered by existing tests.
Are there any user-facing changes?
No.